﻿@page
@model IndexModel
@{
    ViewData["Title"] = "Home page";
}

<form method="post">
    <table class="table">
        <thead>
            <tr>
                <th>ID</th>
                <th>Name</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var customer in Model.Customers)
            {
                <tr>
                    <td>@customer.Id</td>
                    <td>@customer.Name</td>
                    <td>
                        <a asp-page="./Edit" asp-route-id="@customer.Id">edit</a>
                        <button type="submit" asp-page-handler="delete" asp-route-id="@customer.Id">delete</button>
                    </td>
                </tr>
            }

        </tbody>
    </table>
    <a asp-page="./Create">Create</a>
</form>